package com.example.Annocation.Autowire;

import com.example.Annocation.commons.Dao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Description TODO
 * @Date 2024/5/15 16:02
 * @Created by houjunfeng
 */
@Configuration
@ComponentScan("com.example.Annocation.commons")
public class AutowireConfigeration {
    //@Primary可以使得容器自动装配当前修饰的bean
    @Bean(name = "dao2")
    public Dao getDao(){
        return new Dao(2);
    }
}
